1. NodeBox 1
    1. Homepage
    2. NodeBox 3Node-based app for generative design and data visualization
    3. NodeBox OpenGLHardware-accelerated cross-platform graphics library
    4. NodeBox 1Generate 2D visuals using Python code (Mac OS X only)
  2. Gallery
  3. Documentation
  4. Forum
  5. Blog

Reference | BezierPath


Syntax
BezierPath()

DescriptionEach path in NodeBox (see for example, rect(), oval(), endpath(), textpath()) is a BezierPath object. This object has a number of properties to manipulate indivdual points in the path and can be passed to the drawpath() command to draw it on the canvas.
Properties
path.bounds
path.length
path.contours
Methods
path[i]
path.moveto(x, y)
path.lineto(x, y)
path.curveto(h1x, h1y, h2x, h2y, x, y)
path.closepath()
path.rect(x, y, width, height)
path.oval(x, y, width, height)
path.contains(x, y)
path.point(t)
path.points(amount=100)
path.addpoint(t)
path.segmentlengths(relative=False, n=10)
path.intersects(path)
path.intersect(path, flatness=0.6)
path.union(path, flatness=0.6)
path.difference(path, flatness=0.6)
path.fit(x=None, y=None, width=None, height=None, stretch=False)
path.copy()

See the tutorial on paths to learn about all the methods.

With the segmentlengths() method you can define the math precision for point() and points() by making n a higher value (usually 10 is fine).

When you loop over a path it returns a list of PathElement objects.